[[release-notes-5.11.0-M1]]
== 5.11.0-M1

*Date of Release:* April 23, 2024

*Scope:*

* Numerous bug fixes and enhancements regarding field and method search algorithms
* `@FieldSource` annotation for use with `@ParameterizedTest` methods
* `@AutoClose` annotation to automatically close field resources in tests
* `ConversionSupport` utility for converting from a string to a supported target type
* Various documentation improvements

For a complete list of all _closed_ issues and pull requests for this release, consult the
link:{junit5-repo}+/milestone/68?closed=1+[5.11.0-M1] milestone page in the JUnit
repository on GitHub.

For assistance with upgrading, please consult the
link:https://github.com/junit-team/junit5/wiki/Upgrading-to-JUnit-5.11[Upgrading to JUnit 5.11]
page in the Wiki.


[[release-notes-5.11.0-M1-junit-platform]]
=== JUnit Platform

[[release-notes-5.11.0-M1-junit-platform-bug-fixes]]
==== Bug Fixes

* Field and method search algorithms now adhere to standard Java semantics regarding
  whether a given field or method is visible or overridden according to the rules of the
  Java language. See the new
  <<../user-guide/index.adoc#extensions-supported-utilities-search-semantics, Field and
  Method Search Semantics>> section of the User Guide for details.
* `ReflectionSupport.findFields(...)` now returns a distinct set of fields.
* Fixed parsing of recursive jar URIs which allows the JUnit Platform Launcher to be used
  inside Spring Boot executable jars for Spring Boot 3.2 and later.
* The `junit-platform-suite-engine` now includes configuration provided via
  `@ConfigurationParameter` when selecting tests by `UniqueId` (backported to 5.10.3).
* In order to support using `@EnabledInNativeImage` on test classes,
  `UniqueIdTrackingListener` now tracks descendants of skipped test containers (backported
  to 5.10.3).

[[release-notes-5.11.0-M1-junit-platform-deprecations-and-breaking-changes]]
==== Deprecations and Breaking Changes

* As mentioned in the _Bug Fixes_ section above, field and method search algorithms now
  adhere to standard Java semantics regarding whether a given field or method is visible
  or overridden according to the rules of the Java language. The changes in the search
  algorithms may, however, result in breaking changes for some use cases. In light of
  that, it is possible to revert to the previous "legacy semantics". See the new
  <<../user-guide/index.adoc#extensions-supported-utilities-search-semantics, Field and
  Method Search Semantics>> section of the User Guide for details.

[[release-notes-5.11.0-M1-junit-platform-new-features-and-improvements]]
==== New Features and Improvements

* New `ConversionSupport` utility in `junit-platform-commons` which exposes the conversion
  logic that was previously private to JUnit Jupiter's `@ParameterizedTest` infrastructure
  -- for use in third-party extensions and test engines.
* Error messages for type mismatches in `NamespacedHierarchicalStore` now include the
  actual type and value in addition to the required type.
* Updated `open-test-reporting` dependency to `0.1.0-M2`.


[[release-notes-5.11.0-M1-junit-jupiter]]
=== JUnit Jupiter

[[release-notes-5.11.0-M1-junit-jupiter-bug-fixes]]
==== Bug Fixes

* Due to changes in the JUnit Platform regarding field and method search algorithms (see
  <<release-notes-5.11.0-M1-junit-platform-bug-fixes>> above), numerous bugs have been
  addressed within JUnit Jupiter, including but not limited to the following.
  ** Two `@TempDir` fields with the same name in a superclass and subclass will now both
    be injected.
  ** Two `@Test` methods with the same signature in a superclass and subclass will now
    both be invoked, as long as the `@Test` method in the subclass does not override the
    `@Test` method in the superclass, which can occur if the superclass method is `private`
    or if the superclass method is package-private and resides in a different package than
    the subclass.
    *** The same applies to other types of test methods (`@TestFactory`,
      `@ParameterizedTest`, etc.) as well as lifecycle methods (`@BeforeAll`,
      `@AfterAll`, `@BeforeEach`, and `@AfterEach`).

[[release-notes-5.11.0-M1-junit-jupiter-deprecations-and-breaking-changes]]
==== Deprecations and Breaking Changes

* Kotlin support now depends on Kotlin API and language version 1.6; whereas, it
  previously depended on version 1.3.

[[release-notes-5.11.0-M1-junit-jupiter-new-features-and-improvements]]
==== New Features and Improvements

* New `@FieldSource` annotation for use with `@ParameterizedTest` methods which allows
  you to source arguments from a local field or an external field referenced by
  fully qualified field name. This feature is similar to the existing `@MethodSource`
  feature. See the
  <<../user-guide/index.adoc#writing-tests-parameterized-tests-sources-FieldSource, User
  Guide>> for details.
* New `@AutoClose` annotation that can be applied to fields within tests to automatically
  close the annotated resource after test execution. See the
  <<../user-guide/index.adoc#writing-tests-built-in-extensions-AutoClose, User Guide>> for
  details.
* `@TempDir` now suppresses `NoSuchFileException` when attempting to delete files that may
  have been already deleted by another thread or process.
* `JAVA_23` has been added to the `JRE` enum for use with JRE-based execution conditions.
* New <<../user-guide/index.adoc#writing-tests-exceptions, Exception Handling>>
  documentation in the User Guide.
* Improved documentation for <<../user-guide/index.adoc#writing-tests-assumptions,
  Assumptions>> in the User Guide.
* Improved Javadoc for `assertThrows()` and `assertThrowsExactly()` to make it clear that
  the supplied message is not the _expected message_ of the thrown exception.
* Improved documentation for semantics of a disabled test regarding class-level lifecycle
  methods and callbacks.


[[release-notes-5.11.0-M1-junit-vintage]]
=== JUnit Vintage

No changes.
